l = ["java", "spark", "python"]

print("java,spark".split(","))

# 通过一个分隔符将集合拼接成一个字符串
str = "\t".join(l)

print(list(range(10)))
print(list(range(1, 10)))

print(str)

i = 10
s = "100"

# 字符串拼接
print("%d\t%s" % (i, s))

# 1、等腰三角形

"""
   *
  ***
 *****
*******

"""

for x in range(1, 5):
    for y in range(1, 4 - x + 1):
        print(" ", sep="", end="")

    for z in range(1, 2 * x):
        print("*", sep="", end="")

    print()
# 2、九九乘法表    使用列表推导式一行代码可以实现


for x in range(1, 10):
    for y in range(1, x + 1):
        print("%d*%d=%d" % (y, x, x * y), end="\t")

    print()

print("=" * 100)

jiujiu = "\n".join("\t".join(["%d*%d=%d" % (y, x, x * y) for y in range(1, x + 1)]) for x in range(1, 10))

print(jiujiu)
